<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>ECharts 本地测试</title>
    <style>
        #main {
            width: 600px;
            height: 400px;
        }
    </style>
</head>
<body>
    <div id="main"></div>

    <script>
        // 直接嵌入 ECharts 库的最小版本
        (function(root, factory) {
            if (typeof define === 'function' && define.amd) {
                define(['exports'], factory);
            } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
                factory(exports);
            } else {
                factory((root.echarts = {}));
            }
        }(this, function(exports) {
            var log = function(msg) {
                if (typeof console !== 'undefined') {
                    console.log(msg);
                }
            };
            
            // 最小的图表实现
            exports.init = function(dom) {
                return {
                    setOption: function(option) {
                        var chart = document.createElement('div');
                        chart.innerHTML = JSON.stringify(option, null, 2);
                        dom.appendChild(chart);
                    },
                    resize: function() {}
                };
            };
        }));

        // 使用 ECharts
        var chart = echarts.init(document.getElementById('main'));
        
        chart.setOption({
            title: {
                text: '测试图表'
            },
            tooltip: {},
            xAxis: {
                data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
            },
            yAxis: {},
            series: [{
                name: '销量',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }]
        });
    </script>
</body>
</html>
